package com.lcq.gulimall.cart.web;

import com.lcq.gulimall.cart.interceptor.CartInterceptor;
import com.lcq.gulimall.cart.service.CartService;
import com.lcq.gulimall.cart.vo.Cart;
import com.lcq.gulimall.cart.vo.UserInfoTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class CartListController {
    @Autowired
    CartService cartService;
    @RequestMapping("/cartList.html")
    public String cartListPage(Model model){
        Cart cart = cartService.getCart();
        UserInfoTo userInfoTo = CartInterceptor.userInfoToThreadLocal.get();
        model.addAttribute("cart",cart);
        return "cartList";
    }
}
